<div class="row record-elem" ng-repeat="record in vm.invenioSearchResults.hits.hits track by $index">
  <div class="col-xs-12">
    <div class="pull-right view-record hidden-xs">
      <a target="_self" ng-href="/record/{{record.id}}" class="btn btn-default">View</a>
    </div>
    <span class="label label-info" bs-tooltip data-container="div" data-title="Publication date">{{ record.metadata.publication_date|date:'longDate' }}{{ record.conceptrecid ? ' (' + (record.metadata.version || ('v' + (record.metadata.relations.version[0].index + 1))) + ')' : '' }}</span>
    <span class="label label-default">{{ record.metadata.resource_type.title }}</span>
    <span ng-switch on="record.metadata.access_right">
      <span ng-switch-when="embargoed">
          <span class="label label-{{record.metadata.access_right_category}} titlecase" bs-tooltip data-container="div" data-placement="top" data-title="Available as Open Access after {{ record.metadata.embargo_date|date:'longDate' }}">{{ record.metadata.access_right }} Access</span>
      </span>
      <span ng-switch-default>
          <span class="label label-{{record.metadata.access_right_category}} titlecase">{{ record.metadata.access_right }} Access</span>
      </span>
    </span>
    <h4><a target="_self" ng-href="/record/{{record.id}}">{{record.metadata.title}}</a></h4>
    <p>
      <span ng-repeat='creator in record.metadata.creators'>
        <span ng-if='creator.orcid'>
          <a href="http://orcid.org/{{creator.orcid}}"><img class="inline-orcid" src="/static/img/orcid.png" /></a>
        </span>
      <a target="_self" ng-href="/record/{{record.id}}" class="text-muted">{{ creator.name }}</a>;
      </span>
    </p>
    <p class="hidden-xs"><a target="_self" ng-href="/record/{{record.id}}"><span ng-bind-html="record.metadata.description|striptags|limitTo:300"></span></a></p>
    <p>
      <small class="text-muted hidden-xs">
        Uploaded on {{ record.created|date:'longDate' }}
        <p ng-if="record.metadata.journal">
          {{ record.metadata.journal | formatJournal }}
        </p>
      </small>
    </p>
    <p ng-if="!vm.invenioSearchArgs.all_versions && record.metadata.relations.version[0].count > 1">
      <span class="text-muted hidden-xs"><a href ng-click="vm.invenioSearchArgs.q = 'conceptrecid:' + record.conceptrecid; vm.invenioSearchArgs.all_versions = true; vm.invenioSearchArgs.sort='-version'"><small><i>{{ record.metadata.relations.version[0].count - 1 }} more version(s) exist for this record</i></small></a></span>
    </p>

    <hr />
  </div>
</div>
